import 'package:enterprise_v6_app/app/core/http/http.dart';
import 'package:enterprise_v6_app/app/core/utils/interface.dart';
import 'package:enterprise_v6_app/app/data/entities/double_control/get_tb_base_measures_task_entity.dart';
import 'package:get/get.dart';

class AllocationDetailsController extends GetxController {
  ///是否是日常排查
  bool isShowSeason=false;
  List<GetTbBaseMeasuresTaskWorkKindCycleChangeList>?  allCycleChange;
  GetTbBaseMeasuresTaskEntity? data;
  @override
  void onInit() {
    super.onInit();
    //获取指定的风险管控任务详情
    _getTbBaseMeasuresTask();
  }


  _getTbBaseMeasuresTask() async {
    final res = await HttpUtil().generateGetRequest<GetTbBaseMeasuresTaskEntity>(
      Interface.getTbBaseMeasuresTask,
      queryParameters: {'id': Get.arguments},
    ).execute();
    res.onSuccess((result) {
      if (result.data != null) {
        data = result.data!;
        if (result.data?.workKindLabel == '季节性排查' || result.data?.workKindLabel == '重点时段及节假日前排查') {
          //季节性排查 和 重点时段及节假日前排查 需要展示隐藏UI
          isShowSeason = true;
          allCycleChange= result.data?.workKindCycleChangeList;
        } else {
          isShowSeason=false;
        }

      }
    });
    update();
  }
}
